package DomainLayer;

import java.util.*;
 public class DateDifference {
     private int days;
 
 public DateDifference(int year, int month, int day, int lastYear, int lastMonth, int lastDay) 
 {
 Calendar cal1 = new GregorianCalendar();
 Calendar cal2 = new GregorianCalendar();

 cal1.set(year, month, day); 
 cal2.set(lastYear, lastMonth, lastDay);
 days= daysBetween(cal1.getTime(),cal2.getTime());
 }
 
 
 public int getDays()
 {
     return days;
    }
 
 
 
 public int daysBetween(Date d1, Date d2)
 {
        return (int)( (d2.getTime() - d1.getTime()) / (1000 * 60 * 60 * 24));
 }
 }